# 封装handless

# 导入模块
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium import webdriver


def share_browser():
    chrome_options = Options()
    chrome_options.add_argument('--headless')
    chrome_options.add_argument('--disable-gpu')

    # path是自己电脑的Chrome浏览器文件地址
    path = r'C:\Program Files\Google\Chrome\Application\chrome.exe'
    chrome_options.binary_location = path

    service = Service('C:\pydd\pythonProject\chromedriver.exe')

    browser = webdriver.Chrome(service=service, options=chrome_options)

    return browser
